#include "FPCH.h"

#include "FGlyphTransformWavy.h"

namespace Font
{

	GlyphTransformWavy::GlyphTransformWavy(Library* a_Library) : GlyphTransform(a_Library)
	{
		m_Time = 0.f;	
	}
	
	GlyphTransformWavy::~GlyphTransformWavy()
	{
		
	}

	void GlyphTransformWavy::Transform(const tb::Vec2& a_Cursor, GlyphEntry* a_Glyph)
	{
		GlyphTransform::Transform(a_Cursor, a_Glyph);

		float wave_start = tb::Math::SinDeg(a_Glyph->pos_start.x * 30.f + m_Time) * 6.f;
		float wave_end = tb::Math::SinDeg(a_Glyph->pos_end.x * 30.f + m_Time) * 6.f;

		m_Corner[0].y += wave_start;
		m_Corner[1].y += wave_end;
		m_Corner[2].y += wave_start;
		m_Corner[3].y += wave_end;

		m_Time += 0.1f;
	}

}; // namespace Font